Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
Why do I get an "Unexpected character '@'" parsing error when I run ESLint?

I'm getting this parsing error (i.e., error Unexpected character '@' ParseError) returned when running eslint --cache --fix. I'm not sure why I'm seeing this error though, since I don't have an '@' anywhere near that line that's being flagged as problematic. The following is a snippet of my code where the issue is happening:

const getCustomerInformation = async (id, role) => {
    return await gql
        .query({
            query: GET_CUSTOMER_DATA,
            variables: {
                id
            }
        })
        .then((res) => {
            response[role] = res
        })
}

GET_CUSTOMER_DATA is being imported from another file and is as follows:

export const GET_CUSTOMER_DATA = gql`
    query getCustomerInformation($id: String!) {
        OSDTGetCustomerInformation(id: $id) {
            ... on CustomerSuccess {
                id
                fullName
            }
            ... on CustomerError {
                message
            }
        }
    }
`

The line that's being flagged as problematic is query: GET_CUSTOMER_DATA at character 42 in the 1st code block. As mentioned earlier though, I don't see an instance of '@' being used, so I'm not sure why there's a linting issue. I'd really appreciate it if someone could help me understand what could be the issue here.

FWIW, I'm using ESLint v7.31.0.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It turns out that the pre-commit linter was recognizing that I hadn't added any documentation for getCustomerInformation(). So, the linter attempted to solve this by adding a comment with getCustomerInformation()'s parameters (i.e., id & role) that included '@'. However, the linter wasn't adding them in the right place — which is what was throwing the parsing error. So, I had to manually add documentation. I added the following above where getCustomerInformation() is being defined:

/**
* @param {string} id
* @param {string} role
*/
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda